; set the name of the installer
outfile "installer.exe"

; define installation directory
installDir $PROGRAMFILES\osc-radar

; Install pages
Page directory
Page components
Page instfiles

; Uninstall pages
UninstPage uninstConfirm
UninstPage instfiles

; Prompt the user to enter a directory
DirText "This will install Oscilloscope Record onto your computer. Choose a directory"

; Define Components
ComponentText "Please select which component to install"
InstType "Executables"

Section "Executables"
SectionIn 1
    ; Install apps
    setOutPath "$INSTDIR"
    file "osc-record.exe"
    file "osc-radar.exe"
    
    ; create the uninstaller
    writeUninstaller "uninstall.exe"
 
    ; create a shortcut in the start menu programs directory
    ; point the new shortcut at the program uninstaller
    setOutPath "$SMPROGRAMS\osc-radar"
    createShortCut "Uninstall.lnk" "$INSTDIR\uninstall.exe"
    createShortCut "osc-radar.lnk" "$INSTDIR\osc-radar.exe"
    createShortCut "osc-record.lnk" "$INSTDIR\osc-record.exe"
SectionEnd
 
; uninstaller section start
section "Uninstall"

    ; first, delete the uninstaller
    delete "$INSTDIR\uninstall.exe"

    ; Now delete installed file
    delete "$INSTDIR\osc-radar.exe"
    delete "$INSTDIR\osc-record.exe"

    ; second, remove the link from the start menu
    delete "$SMPROGRAMS\osc-radar\osc-radar.lnk"
    delete "$SMPROGRAMS\osc-radar\osc-record.lnk"
    delete "$SMPROGRAMS\osc-radar\Uninstall.lnk"
 
; uninstaller section end
sectionEnd
